function draw_trajectory_comparison(obj,mode,sat)
%DRAW_TRAJECTORY 用于画轨迹
%   1是平面，2是3D
global sc;
myposvel = {obj.My_method_position_result.result}';
% tradition_posvel = {obj.Traditional_position_result.result}';
n = length(myposvel);
for i = 1:n
    myresult(i,:) = cell2mat(myposvel(i));
    % traresult(i,:) = cell2mat(tradition_posvel(i));
end
my_tra = myresult(:,1:3);
my_tra = ecef2lla(my_tra);
% tr_tra = traresult(:,1:3);
% tr_tra = ecef2lla(tr_tra);
    if mode == 2
        lat_tr = obj.trajectorys.PT.("Lat-Lon-Alt")(:,1);
        lon_tr = obj.trajectorys.PT.("Lat-Lon-Alt")(:,2);
        lat_my = my_tra(:,1);
        lon_my = my_tra(:,2);
        lat_trad = tr_tra(:,1);
        lon_trad = tr_tra(:,2);
        geoplot(lat_tr, lon_tr, "b-",lat_my, lon_my, "r-",lat_trad,lon_trad,"g-")
        legend("groundtruth","method in this paper","traditional method");
        % hold on
        % geoplot(lat_my, lon_my, "r-")
        % hold on
        geolimits([min(lat_tr)-0.01,max(lat_tr)+0.01],[min(lon_tr)-0.01,max(lon_tr)+0.01]);
        geobasemap topographic;
    end
    if mode == 3
       aircraft = satellite(sc,obj.trajectorys.PT, CoordinateFrame="geographic", Name="Aircraft");
       aircraft.MarkerColor = [0.8,1,0.3];
       aircraft.MarkerSize = 2;
       aircraft.groundTrack.TrailLineColor = [0,0,1];
       aircraft.groundTrack.LineWidth = 3;

       aircraft2 = satellite(sc,obj.my_PT, CoordinateFrame="geographic", Name="Aircraft");
       aircraft2.MarkerColor = [0.8,1,0.3];
       aircraft2.MarkerSize = 2;
       aircraft2.groundTrack.TrailLineColor = [1,0,0];
       aircraft2.groundTrack.LineWidth = 3;

       % aircraft3 = satellite(sc,obj.tradition_PT, CoordinateFrame="geographic", Name="Aircraft");
       % aircraft3.MarkerColor = [0.8,1,0.3];
       % aircraft3.MarkerSize = 2;
       % aircraft3.groundTrack.TrailLineColor = [0,1,0];
       % aircraft3.groundTrack.LineWidth = 3;
       % pointAt(aircraft,obj.AT,CoordinateFrame="ned");
       % access(aircraft,sat.sat);
       satelliteScenarioViewer(sc,"ShowDetails",false);
       show(aircraft.GroundTrack);
       show(aircraft2.GroundTrack);
       % show(aircraft3.GroundTrack);
    end
    if mode == 4
       aircraft = satellite(sc,obj.PT, CoordinateFrame="geographic", Name="Aircraft");
       aircraft.MarkerColor = [0.8,1,0.3];
       aircraft.MarkerSize = 2;
       aircraft.groundTrack.TrailLineColor = [0.1,0.2,1];
       % pointAt(aircraft,obj.AT,CoordinateFrame="ned");
       access(aircraft,sat.sat);
       satelliteScenarioViewer(sc,"ShowDetails",false);
       show(aircraft.GroundTrack);
    end
    if mode == 5
       traj = obj.trajectorys.PT.("Lat-Lon-Alt");
       plot3(traj(:,1),traj(:,2),traj(:,3),'LineWidth',2,'Color',[0,0,1]);
       legend("groundtruth");
       hold on
       plot3(my_tra(:,1),my_tra(:,2),my_tra(:,3),'LineWidth',2,'Color',[1,0,0]);
       legend("method in this paper");
       % plot3(tr_tra(:,1),tr_tra(:,2),tr_tra(:,3),'LineWidth',2,'Color',[0,1,0]);
       % legend("groundtruth","method in this paper","traditional method");
       legend("groundtruth","method in this paper");
       xlabel('Lat');
       ylabel('Lon');
       zlabel('H');
       plot_beautier;
    end
end